package com.smart.campus.school.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.StudentPaperRelationMapper;
import com.smart.campus.school.domain.StudentPaperRelation;
import com.smart.campus.school.service.IStudentPaperRelationService;
import com.smart.campus.common.core.text.Convert;

/**
 * 学生练习试卷试题关系Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-06-17
 */
@Service
public class StudentPaperRelationServiceImpl implements IStudentPaperRelationService 
{
    @Autowired
    private StudentPaperRelationMapper studentPaperRelationMapper;

    /**
     * 查询学生练习试卷试题关系
     * 
     * @param id 学生练习试卷试题关系ID
     * @return 学生练习试卷试题关系
     */
    @Override
    public StudentPaperRelation selectStudentPaperRelationById(Long id)
    {
        return studentPaperRelationMapper.selectStudentPaperRelationById(id);
    }

    /**
     * 查询学生练习试卷试题关系列表
     * 
     * @param studentPaperRelation 学生练习试卷试题关系
     * @return 学生练习试卷试题关系
     */
    @Override
    public List<StudentPaperRelation> selectStudentPaperRelationList(StudentPaperRelation studentPaperRelation)
    {
        return studentPaperRelationMapper.selectStudentPaperRelationList(studentPaperRelation);
    }

    /**
     * 新增学生练习试卷试题关系
     * 
     * @param studentPaperRelation 学生练习试卷试题关系
     * @return 结果
     */
    @Override
    public int insertStudentPaperRelation(StudentPaperRelation studentPaperRelation)
    {
        return studentPaperRelationMapper.insertStudentPaperRelation(studentPaperRelation);
    }

    /**
     * 修改学生练习试卷试题关系
     * 
     * @param studentPaperRelation 学生练习试卷试题关系
     * @return 结果
     */
    @Override
    public int updateStudentPaperRelation(StudentPaperRelation studentPaperRelation)
    {
        return studentPaperRelationMapper.updateStudentPaperRelation(studentPaperRelation);
    }

    /**
     * 删除学生练习试卷试题关系对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStudentPaperRelationByIds(String ids)
    {
        return studentPaperRelationMapper.deleteStudentPaperRelationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学生练习试卷试题关系信息
     * 
     * @param id 学生练习试卷试题关系ID
     * @return 结果
     */
    @Override
    public int deleteStudentPaperRelationById(Long id)
    {
        return studentPaperRelationMapper.deleteStudentPaperRelationById(id);
    }

    /**
     * 批量保存试卷
     *
     * @param relationList
     */
    @Override
    public void batchInsertStudentPaperRelation(List<StudentPaperRelation> relationList) {
        studentPaperRelationMapper.batchInsertStudentPaperRelation(relationList);
    }
}
